package com.jakewharton.rxbinding4.component;

import static com.jakewharton.rxbinding4.internal.Functions.PREDICATE_ALWAYS_TRUE;
import static com.jakewharton.rxbinding4.internal.Preconditions.checkNotNull;

import io.reactivex.rxjava3.annotations.CheckReturnValue;
import io.reactivex.rxjava3.annotations.NonNull;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.functions.Predicate;
import ohos.agp.components.ListContainer;

public final class RxListContainer {
    @CheckReturnValue
    @NonNull
    public static Observable<ListContainerItemEvent> itemSelected(@NonNull ListContainer view) {
        checkNotNull(view, "view == null");
        return new ListContainerItemSelectedObservable(view);
    }

    @CheckReturnValue
    @NonNull
    public static Observable<ListContainerItemEvent> itemClick(@NonNull ListContainer view) {
        checkNotNull(view, "view == null");
        return new ListContainerItemClickedObservable(view);
    }

    @CheckReturnValue
    @NonNull
    public static Observable<ListContainerItemEvent> itemLongClick(
            @NonNull ListContainer view, Predicate<ListContainerItemEvent> handled) {
        checkNotNull(view, "view == null");
        return new ListContainerItemLongClickedObservable(view, handled);
    }

    @CheckReturnValue
    @NonNull
    public static Observable<ListContainerItemEvent> itemLongClick(@NonNull ListContainer view) {
        checkNotNull(view, "view == null");
        return new ListContainerItemLongClickedObservable(view, PREDICATE_ALWAYS_TRUE);
    }

    private RxListContainer() {
        throw new AssertionError("No instances.");
    }
}
